const any = require("./readjson")
const path = require('path');
const logger = require('tracer').colorConsole();

const _ = require('lodash');

function getBaseObj() {
    let basePac = {};
    let tmp = JSON.parse(any.rfile('/Users/clive/codes/libs/formsy-react/package.json'));
    basePac.devDep = tmp.devDependencies;
    basePac.dep = tmp.dependencies;
    return basePac;
}
function getSecObj() {
    let basePac = {};
    let tmp = JSON.parse(any.rfile('/Users/clive/codes/libs/react-redux-webpack/package.json'));
    basePac.devDep = tmp.devDependencies;
    basePac.dep = tmp.dependencies;
    return basePac;
}

let a = getBaseObj();

let b = getSecObj();

let aa = _.keys(a.devDep);
let bb = _.keys(b.devDep);
let cc = _.intersection(aa,bb)
console.log("base中devpend依赖的组件为:" + aa.join(","));
console.log("sec中devpend依赖的组件为:" + bb.join(","));

logger.warn("两者冲突的js包为:"+cc.join(","));

console.log("为当前的项目下载冲突中的最新版本");

let fi = {};
_.assign(fi, a, b);



